import java.net.URL;
import java.awt.Component;
import java.io.IOException;
import javax.media.*;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.media.NoPlayerException;
import javax.media.CannotRealizeException;
import javax.swing.JPanel;



public class mediapanel extends JPanel
{
	
	public mediapanel(String mediaURL)
	{
		setLayout(null);
		
		Manager.setHint(Manager.LIGHTWEIGHT_RENDERER , true);
		
		try
		{
		MediaLocator ml = new MediaLocator(mediaURL);
		Player mediaPlayer = Manager.createRealizedPlayer(ml);
		Component video = mediaPlayer.getVisualComponent();
		
		video.setBounds(0, 0, 533, 368);
		add(video);
		
		mediaPlayer.start();
		}
		catch(NoPlayerException noPlayerException)
		{
			System.err.println("Can't find player.");
		}
		catch(CannotRealizeException cannotRealizeException)
		{
			System.err.println("Can't realize player.");
		}
		catch(IOException ioException)
		{
			System.err.println("Error Reading source.");
		}
		
	}
}
